import Vue from 'vue';  
import VueRouter from 'vue-router';  
import Home from '../views/Home.vue';  
import CategoryDetail from '../components/CategoryDetail.vue'; // 这个组件稍后创建  
import CategoryList from '../components/CategoryList.vue';  
  
Vue.use(VueRouter);  
  
const routes = [  
  {  
    path: '/',  
    name: 'Home',  
    component: Home,  
  },  
  {  
    path: '/category/:id',  
    name: 'CategoryDetail',  
    component: CategoryDetail,  
  },  
  {  
    path: '/categories',  
    name: 'CategoryList',  
    component: CategoryList,  
  },  
];  
  
const router = new VueRouter({  
  mode: 'history',  
  base: process.env.BASE_URL,  
  routes,  
});  
  
export default router;